/*=================================页面事件============================================================*/
function hotlineLoad(){
	if(bXmlHttpSupport) {
    	var sUrl = 'queryHotlineList.action';
        var request = new XMLHttpRequest();
        request.onreadystatechange = function() {
        	if(request.readyState == 4) {
            	var oRequest = eval('(' + request.responseText + ')');
            	var hotlineList = oRequest.hotlineList;
            	//alert(request.responseText);
            	putHotlineList(hotlineList);
			}
    	};
    	request.open('POST', sUrl);
    	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
    	request.send(null);
    }
}

function updateHotline(){
	if(bXmlHttpSupport) {
    	var sUrl = 'updateHotline.action';
    	var params = 	"hotlineList[0].setValue="+hotlineCustomer1.value +
    					"&hotlineList[1].setValue="+hotlineCustomer2.value +
    					"&hotlineList[2].setValue="+hotlineRentCar1.value +
    					"&hotlineList[3].setValue="+hotlineRentCar2.value +
    					"&hotlineList[4].setValue="+hotlineAddress.value +
    					"&hotlineList[5].setValue="+hotlineCode.value +
    					"&hotlineList[6].setValue="+hotlineEmail.value;
        var request = new XMLHttpRequest();
        request.onreadystatechange = function() {
        	if(request.readyState == 4) {
            	var oRequest = eval('(' + request.responseText + ')');
            	var result = oRequest.result;
            	returnMsg.innerHTML = result;
            	
			}
    	};
    	request.open('POST', sUrl);
    	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
    	request.send(params);
    }
}

/*=================================数据展示============================================================*/
//把取到的值展示到页面上
function putHotlineList(hotlineList){
	hotlineCustomer1.value = hotlineList[0].setValue;
	hotlineCustomer2.value = hotlineList[1].setValue;
	hotlineRentCar1.value = hotlineList[2].setValue;
	hotlineRentCar2.value = hotlineList[3].setValue;
	hotlineAddress.value = hotlineList[4].setValue;
	hotlineCode.value = hotlineList[5].setValue;
	hotlineEmail.value = hotlineList[6].setValue;
}